|
|
|
Appendix B. Functions and Relations |
This appendix explains many interesting functions and relations.
They are presented logically in groups which are in similar order as
GrafEq’s easy button groups. Mathematical symbols not readily available from
the standard keys on a keyboard can be entered with easy buttons; for details,
refer to the Appendix A, the Easy Buttons appendix.
Tip: | A good way to understand and investigate a function or relation is to graph it
with GrafEq! | |
Algebraic Functions
- Exponentiation (including a2, a3, and other simple and
complex power functions) each takes one base term, and one power term.
Hint: | Besides easy buttons, entry of exponentiation can also be initiated by pressing
the up arrow key or the caret key in GrafEq. | |
- Radical (including sqrt, root(3,x), and other simple and complex root functions) each takes
one root index term, and one radical term.
- Logarithm (including log for base 10, lg for base 2,
ln for natural logarithm
or base e, and other simple and complex logarithm functions)
each takes one base term, and argument term.
Hint: | Besides easy buttons, entry of logarithm base can also be initiated by pressing
the down arrow key in GrafEq. | |
Arithmetic Operations
- Addition (+), subtraction (-), and add-and/or-subtract (±) can
be either infix binary with the operator in between two argument terms,
or prefix unary with the operator in front of one argument term.
Hint: | Besides the easy button, the ± symbol can be entered with the
control-+ key combination in GrafEq. | |
- Multiplication (*) and division (/ or ÷) are both infix binary.
Hint: | Besides the easy button, the ÷ symbol can be entered with the
control-/ key combination in GrafEq. | |
Factoring Functions
- Modulo (mod) takes two argument terms, and returns the positive remainder of
the division of the first argument term by the second argument term.
- Least common multiple (lcm) and
greatest common divisor (gcd) each
takes two or more argument terms, and are generalized to real valued arguments.
- Gamma (gamma) function is a continuous extension of the factorial function. For any
non-negative integer x, gamma(x+1) is equal to x!.
- Factorial (!) is postfix unary with the operator,
following one argument term.
It is a recursively defined function: for any non-negative integer x,
(x+1)! returns (x+1)x!, and 0! returns 1.
Integer Functions
Integer functions convert real values to integers. Each function takes one argument.
- Floor (⌊x⌋) returns the closest integer smaller than or
equal to the argument value.
Hint: | Besides the easy buttons, the floor symbols can be entered with the
control-[ and control-] key combinations in GrafEq. | |
- Ceiling (⌈x⌉) returns the closest integer larger than or
equal to the argument value.
Hint: | Besides the easy buttons, the ceiling symbols can be entered with the
control-{ and control-} key combinations in GrafEq. | |
- Round (Round) and round (round) both return the
closest integer from the argument value; but if
the argument value ends with ‘.5’, such as 4.5, Round would
round up and return 5, while round would round down and return 4.
- Trunc (trunc) returns the integer portion of the argument value, by deleting the
fractional part. It returns the same value as the floor function for
positive argument values; and
the same value as the ceiling function for negative argument values.
Measure Functions/Magnitude Operators
- Absolute Value (|x|) takes one argument, and returns the value without the sign.
- Signum (signum) takes one argument, and returns -1 for a negative argument,
1 for a positive argument, and 0 for an argument that equals 0.
- Angle (angle) takes two arguments x and y,
and return the
angle between the point (x,y) and the x-axis.
Order Functions
- Minimum (min) and
maximum (max) each takes two or more arguments,
and returns the smallest, and largest value respectively.
- xth minimum (minx) and
xth maximum (maxx)
each takes a number of argument equal to or larger than the value of x, where
x is a positive integer.
minx returns the xth smallest, and
maxx returns the xth largest value.
Hint: | If x does not evaluate to an integer between 1 and the number of arguments,
both functions would be undefined. | |
Relational Functions
Equal to (=), less than (<), greater than (>)
and other simple and complex, positive and negative relations
are all infix binary, with the operator in between two terms.
Hint: | Besides easy buttons, less than or equal to can also be entered with the
control-< key combination; greater than or equal to
with the control-> key combination in GrafEq. | |
Set and Conditional Functions
- Set element listings are to be enclosed within pairs of braces ({}),
with a comma (,) separating every two successive set elements.
- Set membership can be defined with is member (e) and
is not member (e!).
Hint: | Besides easy button, is member of can also be entered with the
control-= key combination in GrafEq. | |
- Conditional definitions are described within pairs of braces ({}),
with one or more sets of a value term followed by if (if), then the condition.
An example is: y={x if x>=0; -x if x<0}
Hint: | Pairs of braces, brackets, as well as parentheses can also be
used to control precedence. | |
Trig Functions and Relations
All trig functions and relations take one argument each.
- Trig functions include circular, hyperbolic, square, and diamond
functions.
- Circular trig functions are based on the circle, and
include sine (sin), cosine (cos), tangent (tan),
cosecant (csc), secant (sec), and cotangent (cot).
- Hyperbolic trig functions are based on the hyperbola, and
include the six functions of the circular ones, but with an appended “h”.
They are sinh, cosh, tanh,
csch, sech, and coth.
- Square trig functions are based on the square, and
include the six functions of the circular ones, but with an appended “q”.
They are sinq, cosq, tanq,
cscq, secq, and cotq.
- Diamond trig functions are based on the diamond parallelogram, and
include the six functions of the circular ones, but with an appended “d”.
They are sind, cosd, tand,
cscd, secd, and cotd.
- Inverse Trig Functions also include circular, hyperbolic, square, and diamond
functions. Each collection has the same trig functions, but with a preceding “Arc”.
They include Arcsin, Arccosd, and so on.
- Inverse Trig Relations also include circular, hyperbolic, square, and diamond
relations. Each collection has the same trig operations, but with a preceding “arc”.
They include arcsin, arccosd, and so on.
To conclude this section of the manual,
following are some additional hints and tips about
GrafEq functions, relations, and operations:
- Each argument or term can be a simple term or a complex term that can
contain any number of functions, operations, and values. Complex terms might need
to be enclosed in appropriate/necessary parentheses.
- Degree (°), Minute ('), and Second ('')
returns p/180, p/(180*60), and p/(180*60*60) respectively.
Hint: | 5'33'' is interpreted
as the multiplication product of 5p/(180*60) and 33p/(180*60*60). | |
- Precedence of operations:
- Bracket-like operators, such as brackets, parenthesis, braces, floor,
ceiling, absolute value, and conditional/piecewise definition
- Postfix operators, such as factorial
- Exponentiation
- Multiplication and division
- Prefix operators, such as negation
- Addition and subtraction
- Comparisons, such as equal-to, less-then, and greater-then
- Precedence for function application is not clear cut.
For example, sin2x is parsed as sin(2x); multiplication has higher precedence than
the sine function. However, sinxcosx is parsed as (sinx)(cosx);
multiplication has higher precedence in sin2x, but has lower precedence in sinxcosx.
- The visual mathematics formating which GrafEq’s algebraic window presents
often reflect whether a specification is entered correctly.
If in any doubt, parentheses or brackets can always be used.
Tip: | The structural tree structured relation description is a new feature
introduced in GrafEq 2.04, and can be used for accurate confirmation. | |